home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / cli / gulaminf.arc / GULAM.INF
Text File  |  1988-05-16  |  78KB  |  2,185 lines

  1. Info file gulam.info, produced by texinfo-format-buffer   -*-Text-*-
  2. from file g.txi
  3.  
  4.  
  5. File: gulam.info  Node: top, Up: (DIR), Next: usage
  6.  
  7. Introduction
  8. ============
  9.  
  10. *Gulam* is a shell (i.e., a command line interpreter) for AtariST
  11. computers.  It contains some 60+ built-in commands, provides file name
  12. completion a la *TENEX*, has history, alias and rehash
  13. facilities, and integrates the shell with microEmacs easing the
  14. editing of commands being issued.  Among the built-in commands are
  15.  
  16. `egrep'     
  17.      a regular expression based string  pattern  finder.
  18. `te'     
  19.      a simple terminal emulator.
  20. `rx/sx'     
  21.      Xmodem  file  transfers
  22. `pr'     
  23.      a text file printer with pagination.
  24.  
  25. In common usage, it resembles *csh* of *Unix 4.xBSD*;
  26. Gulam's control structures, lexical conventions and other details are,
  27. however, quite different from csh.  While I have borrowed ideas from
  28. other shells (such as Korn shell), I made no heroic attempts to be
  29. compatible with any.  Where possible, I have tried to make
  30. *Gulam* less `surprising' in what it does.
  31.  
  32. The word *Gulam* is pronounced as *Gulaam* in Hindi/Urdu,
  33. and means an obedient servant.
  34.  
  35. *Gulam* is a free program; you are encouraged to give it to others,
  36. but at no cost.  However, the source is copyrighted (i.e., it is not in the
  37. public domain) and will be part of a book on systems programming I am
  38. writing.  The source is available on request, with the usual provisos
  39. regarding material in manuscript form.  This manual is written in the
  40. *TeXinfo* format (the *GNU* documentation format); a laser-printed
  41. TeX-typeset copy of this 40-page manual is also available at cost ($2.00).
  42.  
  43. I am advised to include a disclaimer because there are unreasonable people
  44. out there.
  45.  
  46. "I make no warranty with respect to this manual, or the program it
  47. describes, and disclaim any implied/explicit suggestions of usefulness for
  48. any particular purpose.  Use this program only if you are willing to assume
  49. all risks, and damages, if any, arising as a result, even if it is caused
  50. by negligence or other fault."
  51.  
  52. The first release of this program did contain bugs.  The present
  53. beta-version (dated Sept 1987) is a result of fixing 15 bugs, 9 internal
  54. code improvements (about 180 lines of rewriting), 9 user-visible
  55. improvements.  I am sure this version too has bugs, and undesirable
  56. features.  Users are encouraged to tell me both good and bad things about
  57. this program.
  58.  
  59.  
  60. Many thanks to: Jwahar R.  Bammi for help in every aspect during the
  61. writing of the shell and this manual, and demanding that
  62. *Gulam* be a `reasonably full fledged' shell; David Conroy for
  63. writing a `small is beautiful' microEmacs; Henry Spencer for the
  64. regexp(3) package that is now built into *Gulam*; AtariST for
  65. its value to price ratio.  The program was developed using Megamax and
  66. Mark Williams C compilers.  It now uses my own malloc.c.
  67.  
  68.  
  69.  
  70. Comments on the Present Implementation
  71. ======================================
  72.  
  73. I find the present implementation eminently useable, and indeed use it
  74. all the time, in preference to other shells.
  75.  
  76. Here are some features that I (still) find unsatisfactory.  Control
  77. structures are quite ad-hoc, and incomplete.  I had a tough time in
  78. decreeing that the typical `+-*/()[]{}' are not delimiters; but
  79. that decision made *Gulam* smaller.
  80.  
  81. Here is a list (complete?) of things new and/or diffrent from the
  82. alpha-version.
  83.  
  84.   1. the bugs causing memory-lossage have been fixed.
  85.   2. an application program can now call one of *Gulam*'s routines
  86.      that is equivalent to system() call.
  87.   3. an application program can now call one of *Gulam*'s routines
  88.      that can receive keyboard input from the user, with all the facilities of
  89.      `ue', and return the line input by the user.
  90.   4. `ue' can now insert-file.
  91.   5. stdout append-redirection (`>>') is now implemented.
  92.   6. a new sub-word consisting of three dots `...' expands to the list
  93.      of all filenames rooted at the current or given directory.
  94.   7. doing a `set path <path-list>' will also cause an automatic
  95.      `setenv PATH <path-list> ; rehash'.
  96.   8. `ue' can now fill-paragraph.
  97.   9. new shell variable `verbosity' controls how silent *Gulam* is.
  98.  10. cp will not copy directories and their contents unless
  99.      given the `-r' flag.
  100.  11. `ue' can now use mouse movements as cursor
  101.      movements (see mscursor).
  102.  12. diskettes can be formatted (single/double-sided) in TOS standard way.
  103.  13. the command mem can not only report the GEMDOS free-list but also the list
  104.      of GEMDOS Malloc-ated chunks.
  105.  14. shaded background on the screen is provided for the `gem' command.
  106.  15. the keypad keys can be toggled to become numeric
  107.      or extra-function keys.
  108.  16. there are 3 separate key-bindings for the one *gulam* buffer, and
  109.      the one *mini* buffer, and all the regular buffers.
  110.  
  111. File: gulam.info  Node: usage, Prev: top, Up: top, Next: lexical-conventions
  112.  
  113. General Usage
  114. =============
  115.  
  116. The syntactic details of individual commands, and the specific rules that
  117. are followed in evaluating them are given later.  This section is an
  118. overview of how the integration of `ue' with a shell is used.
  119.  
  120. The moment you enter *Gulam*, you are in a ue-buffer
  121. called *mini*.  Thus, all the typical `ue' text-editing
  122. functions are available, except commands such as `Visit-file',
  123. `Switch-to-buffer', etc.  The `RETURN' key causes the entire
  124. line (on which the return is typed) to be evaluated.  The output, if
  125. any, of the command you issued appears on the screen but does not
  126. enter any ue-buffer.  The built-in command `ue' (without any
  127. arguments) takes you into the special ue-buffer named *gulam*;
  128. the output of (built-in) commands issued while you are in *gulam*
  129. does enter that buffer, which can be freely edited.  The command
  130. `ue' FILENAME will read-in each of the named files into
  131. their ue-buffers.  From within `ue', you can
  132. `Switch-to-Gulam-buffer' (whose default binding is `ESC-g').
  133.  
  134. To conserve/manage memory, we release all `ue' buffers when `ue'
  135. is exited in the usual way (i.e., `UNDO', or `⑧-⇨');
  136. exiting temporarily via the `ə' does not release memory.
  137. Issuing a substantial number of commands through the *mini* buffer,
  138. without entering `ue' in between, will accumulate all the commands
  139. (but not their output) in the *mini* buffer, and soon there will be a
  140. memory shortage.  To prevent this, enter and exit `ue' once in a
  141. while, or delete (using `⇦', or `Delete') characters in the
  142. *mini* buffer.
  143.  
  144.  
  145.  
  146. File: gulam.info  Node: lexical-conventions, Prev: usage, Up: top, Next: command-processing
  147.  
  148. Lexical Conventions
  149. ===================
  150.  
  151. All  input  to  *Gulam*  is  case-sensitive; on the other hand, TOS
  152. file names are case-independent.  
  153.  
  154. The  evaluation  of  the command line  begins by dividing it into
  155. "words" and "subwords".  The "word-delimiters" are
  156. space, tab, return, line-feed (the so-called white chars),
  157. single-quote, double-quote, semicolon, and the vertical-bar.
  158.  
  159.  
  160. Note that  `+-*=/()[]{}' etc. are *not* "word-delimiters".  A
  161. "word"  is  either
  162.  
  163.    * A  sequence  of  chars  not containing any "word-delimiters".
  164.    * A  string  of  arbitrary chars enclosed in single/double-quotes.
  165.    * A `semicolon'.
  166.    * A `vertical-bar'.  
  167.  
  168. Eg,  the lines below 
  169.  
  170.      date  01-22-87-22:08:34  #sets the TOS and ikbd date-time
  171.      alias c 'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .'
  172.      if    {$x + $y ==23 }
  173.      if    { -e $1.c }
  174.  
  175. would be divided into the words (shown between slashes) 
  176.  
  177.      /date/01-22-87-22:08:34/#sets/the/TOS/and/ikbd/date-time/
  178.      /alias/c/'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .'/
  179.      /if/{$x/+/$y/==23/}/
  180.      /if/{/-e/$1.c/}/
  181.  
  182. "Comments" begin  with  a  word  whose first char is `#', and
  183. end  at  the  end  of line.  A `#' embedded in the middle of a word
  184. does not begin a comment.  
  185.  
  186. The "subword-delimiters" are the characters in 
  187. `!@#$%^&-=+`~{}:;'"\|,.<>/'.
  188.  
  189. File: gulam.info  Node: command-processing, Prev: lexical-conventions, Up: top, Next: batch-files
  190.  
  191. Outline of Command Processing
  192. =============================
  193.  
  194. The command line is string pre-processed as described below before invoking
  195. it as a command.
  196.  
  197.    * History substitutions occur first.
  198.    * Dollar substitutions, wiggle  expansion,  meta  expansions  occur second.
  199.    * Split the resulting  line  into semi-colon separated commands.
  200.    * For each command,  alias  expand  it,  and  dollar-substitute.
  201.    * Execute each resulting command.  
  202.  
  203. File: gulam.info  Node: batch-files, Prev: command-processing, Up: top, Next: buffers
  204.  
  205. Batch Files
  206. ===========
  207.  
  208. A "batch file", also called a shell file, is a text file containing
  209. *Gulam* commands, both internal and external.  Such files must have
  210. the extension `.g' for them to be recognized as commands.  See the
  211. section on `gulam.g' for an example shell file.
  212.  
  213. In processing these files *Gulam* uses `ue' buffers.  So, if
  214. you have `ue' as a command in a batch file, and then exit `ue'
  215. with either `UNDO' or `⑧-⇨', all the buffers
  216. (including the one holding the batch file) will be released, and
  217. *Gulam* will surely crash. So, do *NOT* include `ue' as a
  218. command in a shell file.
  219.  
  220. Redirections to/from batch files do not work properly.
  221.  
  222. File: gulam.info  Node: buffers, Prev: batch-files, Up: top, Next: command-line-editing
  223.  
  224. Buffers: Gulam, Mini and Regular Buffers
  225. ========================================
  226.  
  227. Once you invoke *Gulam*, you are always in one of the microEmacs
  228. (*uE*) "buffers" which are reservoirs of text.  In this program, a
  229. typical line-oriented command shell is integrated with microEmacs.  This
  230. necessitated two special kinds of buffers, named *gulam* and
  231. *mini*, along with the regular buffers.
  232.  
  233. Right after you invoke *Gulam*, you are in *mini*, and each
  234. line you type is taken as a *Gulam* command, and executed.  Any
  235. output produced by such a command is displayed on the screen but not
  236. entered into any microEmacs buffer.  Should you desire to capture such
  237. output into a buffer, enter the *gulam* buffer by typing `ue'
  238. without any arguments.  If you are editing in a regular buffer elsewhere in
  239. microEmacs, pressing `ESC-g' (see `kb' below for
  240. `switch-to-Gulam-buffer') will get you into *gulam*.
  241.  
  242. While you are in *Gulam*, the `RETURN' key behaves as it does in
  243. *mini*.  All command input, including giving the names of buffers
  244. within `ue', takes place in *mini*.  The window for this buffer
  245. is always at the bottom of screen, and usually only one-line high.  (Some
  246. of you may want to experiment with `⑧-ə' and
  247. `⑧-z'.) You enter the *mini* either because (A) you are
  248. outside the normal microEmacs, or (B) a command such as
  249. `Switch-to-buffer' wants to read your input.  The *mini* is like
  250. any other buffer except for the bindings of a few keys, and the disallowing
  251. of `ue' functions that change/switch buffers/windows/files.  One of
  252. these exceptional keys (in *mini*) is the `RETURN' key: it will
  253. submit the entire line -- even if the cursor was somewhere in the middle of
  254. the line-- to the shell (case A), or to such `ue' commands as
  255. `Visit-File' (case B).  Until you press `RETURN', you can edit not
  256. only that line but others in *mini* just as you would in regular
  257. buffers.
  258.  
  259. Note that unless you occasionally exit microEmacs with
  260. `⑧-⇨' or `UNDO', both *gulam* and *mini*
  261. buffers will keep growing, and you may run out of memory.
  262.  
  263. File: gulam.info  Node: command-line-editing, Prev: buffers, Up: top, Next: invoking-gulam
  264.  
  265. Command Line Editing
  266. ====================
  267.  
  268. Full microEmacs editing is available while typing the command.  Thus, you
  269. can transopse chars by `④', and go to the beginning of the line
  270. by `⇧', and ⑨ank in a perviously deleted word, etc.
  271.  
  272. In addition to these, there are three convenience features.  After typing
  273. the first few chars of a file name, if you press the key marked
  274. `INSERT', *Gulam* will attempt to complete the file name;
  275. pressing `CLR/HOME' will show all possible completions.  Secondly, if
  276. you type `!n' and then press `INSERT', you will see that the
  277. history-expanded result is brought into the buffer, which can then be
  278. further edited if necessary.  Thirdly, pressing the `DOWNARROW' key
  279. will cycle you through the previous commands.
  280.  
  281.  
  282. File: gulam.info  Node: invoking-gulam, Prev: command-line-editing, Up: top, Next: Glossary
  283.  
  284. Invoking Gulam
  285. ==============
  286.  
  287. *Gulam* can be used in four ways.  Two of these four use `TOS'
  288. variable named `_shell_p' (at `0x04f6L').  This (supposedly)
  289. contains a pointer to a routine that takes a string as an argument and
  290. executes it as a shell command.  *Gulam* has slightly extented this.
  291. `*_shell_p', as set by *Gulam*, points the bottom of a (jump)
  292. table, which currently is:
  293.  
  294.              .long   0x86420135        / our magic number
  295.              jmp     getlineviaue_
  296.      togu_:  jmp     callgulam_
  297.  
  298. Thus, `*((long *) 0x04f6L)' == address of `togu_'.  Before
  299. invoking either routine, it always is a good idea to check if the magic
  300. number is present.  Let `mp = *((long *) 0x04f6L) - 12L'.  Then,
  301. `*mp' better be `0x86420135'.
  302.  
  303.   1. The most common usage is as an (outermost) interactive shell.
  304.      Double-click on `gulam.prg'.  Keep your version of `gulam.g' also
  305.      in the same folder.
  306.   2. `int callgulam(p) char *p;' returns the status of executing
  307.      shell command given as a string pointed by `p'.  Let `fp =
  308.      *((long *) 0x04f6L)'.  Then to call this routine, you do `(*fp)(p)'.
  309.   3. `void getlineviaue(p) char *p;' returns in the user-supplied
  310.      array of chars pointed by `p' the command line typed by the user.  Full
  311.      uE editing facilities are available in this inputting process.  `p' must
  312.      point to an array of at least 256 chars; longer input lines cannot be
  313.      given.  The line may contain control characters (inserted by the ^Q
  314.      feature of `ue').  It is ascii NUL terminated.  Let `fp = *((long *)
  315.      0x04f6L) - 6L'.  Then to call this routine, you do `(*fp)(p)'.
  316.   4. For non-interactive use, *Gulam* can be invoked (from shells, from
  317.      application programs via `Pexec()', or `callgulam()') with arguments.
  318.  
  319. `gu 'ls -l' 'echo hello'' is similar to typing the two commands to the
  320. shell in interactive mode.
  321.  
  322. `gu 'pwd' -c scrpt a b c d' does `pwd', and then invokes the
  323. (presumably valid) *Gulam* shell script named `scrpt.g' with
  324. `a b c d' as the script files arguments.  Following the `-c'
  325. must be the name of a batch file.
  326.  
  327. *Gulam* has no other options.
  328.  
  329. File: gulam.info  Node: Glossary, Prev: invoking-gulam, Up: top, Next: top
  330.  
  331. Glossary
  332. ========
  333.  
  334. File: gulam.info  Node: builtins, Prev: Glossary, Up: Glossary, Next: cd
  335.  
  336.  
  337. Builtin Commands
  338. ----------------
  339.  
  340. A command executed directly by the shell is called a "built-in"
  341. command.  The 62 built-in commands of *Gulam* are:
  342.  
  343.      alias dm     endwhile help    more  printenv set    ue
  344.      cat   dirc   exit     history mson  pushd    setenv unalias
  345.      cd    dirs   fg       if      msoff pwd      source unset
  346.      chmod echo   fgrep    kb      mv    rehash   sx     unsetenv
  347.      copy  egrep  foreach  lpr     peekw ren      te     which
  348.      cp    ef     format   ls      pokew rm       teexit while
  349.      date  endfor gem      mem     popd  rmdir    time
  350.      df    endif  grep     mkdir   print rx       touch
  351.  
  352. File: gulam.info  Node: alias, Prev: Glossary, Up: Glossary, Next: cat
  353.  
  354. alias
  355. -----
  356.  
  357. The `alias' built-in command works almost like a shell file but one
  358. that is stored in the internal data structures of *Gulam*.  It often
  359. just specifies a shorter or different name for a command.
  360.  
  361.      alias cc c:\megamax\mmcc.ttp    #1
  362.      unalias cc                      #2
  363.      alias c 'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .' #3
  364.      alias r  'echo $1.c $1.o; r'    #4
  365.      alias                           #5
  366.      alias g 'echo $3 $1'            #6
  367.      alias cg 'f:\cc.ttp -c -Ie:\gulam -DMWC e:\gulam\$1.c' #7
  368.  
  369. Alias without args (see #5) lists all the aliases that are currently
  370. defined.  The command unalias (see 2) removes the def of an alias.  Line 4
  371. shows a recursive definition; try it out!  If we invoke `g' as in
  372. `g a b c d e f' this is equivalent to `echo c a d e f'; i.e., all
  373. arguments above the highest that was used in a "$-substitution" are
  374. appended to the resulting command string before executing it.
  375.  
  376. File: gulam.info  Node: cat, Prev: alias, Up: Glossary, Next: cd
  377.  
  378. cat
  379. ---
  380.  
  381. This command `catenates' files to the standard output (normally screen).
  382. By redirecting output, you can concatenate several files into a combined
  383. file.
  384.  
  385.      cat f1 f2 >f3    # f3 will now equal f1 followed by f2
  386.      cat f1 > prn:    # print the file f1 as is; see also print and lpr
  387.      cat f1        # show it on the screen; use ^S/^Q to stop/go
  388.  
  389. File: gulam.info  Node: cd, Prev: cat, Up: Glossary, Next: chmod
  390.  
  391. cd
  392. --
  393.  
  394. The `cd' command changes the current working directory; it also sets
  395. the shell variable named `cwd', the environment variable
  396. named  `CWD'.  If `cd' was given noarguments,  it is equivalent
  397. to `cd $home'.
  398.  
  399. File: gulam.info  Node: chmod, Prev: cd, Up: Glossary, Next: cp
  400.  
  401. chmod
  402. -----
  403.      chmod [+-whsvm] FILENAMES
  404.  
  405. `chmod' changes the read/write attributes of the files.  The
  406. `+' flags have inverse effect to the `-' flags.  The `+w'
  407. makes them read-write, and `-w' makes them read-only.  The
  408. `+h' hides the files from directory searches; `+s' marks
  409. them as hidden system files; `-m' turns off the `archived' flag
  410. on the file.
  411.  
  412.  
  413. File: gulam.info  Node: cp, Prev: chmod, Up: Glossary, Next: date
  414.  
  415. cp
  416. --
  417.      cp FILENAMES TARGET-DIR
  418.      cp FILENAME1 FILENAME2
  419.  
  420. Copies files.  In the first form, any number of files may be copied into
  421. the destination directory; files in the target dir will have their original
  422. names.  In the second form, only one file is copied, and the new one will
  423. be named filename2.
  424.  
  425.      cp FNM FNM    # will exit with status -1 
  426.      cp -r D1 DIR2     # if d1 is a directory, this command
  427.                    # will create a dir named d1 in dir2, and 
  428.                    # copies all the files in d1 to to dir2\d1 
  429.  
  430. In the second example above, if -r option is omitted, cp will ignore any
  431. directory names in the list of source files.  Use the -r option with
  432. caution.  E.g.,
  433.  
  434.      cp -r d1  d1\d2 # is dangerous 
  435.  
  436. will, assuming that d1\d2 is a directory, copy/create subtree d1 inside d2.
  437. But, the problem is that d1 will keep growing as a result until of course
  438. there is no more room on the target disk!
  439.  
  440. A simple way to print a file as is, instead of using lpr or print, is to
  441.  
  442.      cp fnm prn: 
  443.  
  444. There is a `+t' option that gives the created target files the time
  445. and date of the source files.  If you care about this, you may want to set
  446. up an alias as in:
  447.  
  448.      alias cp 'cp +t' 
  449.  
  450.  
  451. $cwd and $CWD
  452. -------------
  453.  
  454. The shell variable named `cwd' (and env var named `CWD') holds the
  455. full path name of the current working directory.  
  456.  
  457. File: gulam.info  Node: date, Prev: cp, Up: Glossary, Next: df
  458.  
  459. date
  460. ----
  461.  
  462. The `date' command, without arguments, prints the current date and
  463. time.  With arguments, it sets the date and time.  
  464.  
  465.      date 01-22-87-22:08:34 
  466.  
  467. will set the date to Jan 22, 87 and time to 10:08:34 pm.  Instead of hyphen,
  468. and colon, other delimiters can be used, as long as the whole argument of date
  469. is still one word.
  470.  
  471. File: gulam.info  Node: df, Prev: date, Up: Glossary, Next: dm
  472.  
  473. df
  474. --
  475.      df DRIVENAMES
  476.  
  477. `df'  shows the free space on the asked for drive(s); e.g.,
  478.      df a c f
  479.  
  480. File: gulam.info  Node: dm, Prev: df, Up: Glossary, Next: dirc
  481.  
  482. dm
  483. --
  484.  
  485. `dm' (drive map) gives a string of letters that stand for the
  486. installed drives.
  487.  
  488. File: gulam.info  Node: dirc, Prev: dm, Up: Glossary, Next: dirs
  489.  
  490. dir cache dirc
  491. --------------
  492.  
  493. To help do the Tenex file name completion efficiently, there is a
  494. cache of contents of directories.  `dirc' shows the names of
  495. these dirs, and how many bytes are used by their contents.  Unless you
  496. did a `set dir_cache 1', or you executed commands that only
  497. examine the file system the `dirc' has nothing to show since the
  498. cache is flushed at the end of each command.  Try *Gulam* with
  499. `dir_cache' set to 1.  Note however that this cache is updated
  500. only by commands that change the contents of a directory (such as
  501. `rm', `cp').  A rather annoying result is that even after
  502. you change the diskette in a drive, you may see the directory contents
  503. of the previous diskette listed.  An `UNDO', `dirc -',
  504. `rm' with/without arguments will explicitly flush the cache.
  505.  
  506. File: gulam.info  Node: dirs, Prev: dirc, Up: Glossary, Next: echo
  507.  
  508. dirs
  509. ----
  510.  
  511. *Gulam* has an internal stack of directories whose content is
  512. printed by the `dirs' command.  The built-in commands `pushd',
  513. and `popd' are the only others that operate on this stack.
  514.  
  515. File: gulam.info  Node: dollar-substitutions, Prev: command-line-editing, Up: top, Next: expressions
  516.  
  517. Dollar-substitutions
  518. --------------------
  519.  
  520. The subword `$x' in a command is substituted by the value of it.  If
  521. `x' is the name of a shell var, or an environment var, then `$x'
  522. is the value of that variable.  If `x' is an unsigned number, it
  523. stands for the x-th argument; thus, `$0' usually gives the command
  524. name.   `$*'  stands  for the text of the entire command; `$-' stands
  525. for  words  `$1'  to dollar-last; `$<' stands for the on-demand input
  526. given by the user.  
  527.  
  528.  
  529.  
  530. Dotg.g
  531. ------
  532.  
  533. -- see Batch Files, and gulam.g 
  534.  
  535. File: gulam.info  Node: echo, Prev: dirs, Up: Glossary, Next: ef
  536.  
  537. echo
  538. ----
  539.  
  540. The `echo' command prints its arguments.  
  541.  
  542.      echo c:\mwc\...    # all the fnms in the dir tree rooted at c:\mwc will be echoed
  543.  
  544. File: gulam.info  Node: ef, Prev: echo, Up: Glossary, Next: egrep
  545.  
  546. ef
  547. --
  548. -- stands for `elseif'; see `if'
  549.  
  550. File: gulam.info  Node: egrep, Prev: ef, Up: Glossary, Next: endif
  551.  
  552. egrep
  553. -----
  554. -- see `grep'
  555.  
  556. File: gulam.info  Node: endif, Prev: egrep, Up: Glossary, Next: endfor
  557.  
  558. endif
  559. -----
  560. -- see `if'
  561.  
  562. File: gulam.info  Node: endfor, Prev: endif, Up: Glossary, Next: exit
  563.  
  564. endfor
  565. ------
  566. -- see foreach
  567.  
  568.  
  569. Style of Environment String 
  570. ----------------------------
  571.  
  572. This shell var controls the format of the environment string supplied to
  573. the external command invoked through *Gulam*.
  574.  
  575.      set env_style bm # to get a style of env a la MS-DOS
  576.      set env_style mw # Mark Williams
  577.      set env_style gu # the "normal" style, a la Unix
  578.  
  579. File: gulam.info  Node: exit, Prev: endfor, Up: Glossary, Next: fg
  580.  
  581. exit
  582. ----
  583.      exit [NUMBER]
  584.  
  585. The `exit' built-in command is used to force termination of a shell
  586. script.
  587.  
  588. File: gulam.info  Node: expressions, Prev: dollar-substitutions, Up: top, Next: flags
  589.  
  590. Expressions 
  591. ------------
  592.  
  593. An "atomic exp" is either a NUMBER, a FILENAME, a FILE
  594. PREDICATE, a { EXP }, or ! ATOMIC EXP.
  595.  
  596. A FILE PREDICATE on a file name FNM is of the form `-c
  597. FNM' where `c' is in `{e, f, d, h, v, m}'.  These letters
  598. stand for "exists", "is-a-regular-file", "is-a-dir",
  599. "is-a-hidden-file", "is-a-volume-label", and
  600. "is-an-archived-file".  A FILEPRED yields 1 if it is true, 0
  601. otherwise.
  602.  
  603. An arithmetic expression is constructed using the operators `+-/%*'.
  604. All these are of equal precedence and evaluated left-to-right; thus,
  605. `2 + 4 / 2' is equal to 3.  However, the braces raise the precedence
  606. of the ops within them; thus, `2 + { 6 / 2}' is equal to 5.  An exp
  607. with no operators, i.e., an atom, is a special case because we want the
  608. string form of the atom (e.g., as for `blah' in `set s blah').  A
  609. non-numeric string yields 0 as its numeric value in an arith exp.
  610.  
  611. A "relational expression" is of the form `arithexp relation
  612. arithexp', where relation is any one of `<=, <, ==, !=, >,' or
  613. `>='.  Such a relation yields a 1 if it holds, 0 otherwise.
  614. (Relational operators among strings are not implemented yet.)  You may
  615. combine expressions using the boolean operators `&&' and `||'
  616. (which are not, for now, short-circuit evaluated).
  617.  
  618. Note the spaces in the examples above; see Lexical Structure.  
  619.  
  620. File: gulam.info  Node: fg, Prev: exit, Up: Glossary, Next: file-names
  621.  
  622. fg
  623. --
  624.  
  625. `fg' is part of the simulation of what we were used to doing on Unix
  626. with GNU-Emacs: get out of it by stopping GNU (`ə' in ue/Gulam),
  627. do a few shell commands and get back in by `fg' (works the same in
  628. ue/Gulam).
  629.  
  630.  
  631. File: gulam.info  Node: file-names, Prev: fg, Up: Glossary, Next: foreach
  632.  
  633. File Names
  634. ----------
  635.  
  636. There are many conveniences in *Gulam* that relate to specifying
  637. filenames.  It can complete a file name given its first few characters.
  638. (Tenex is widely considered to be the first OS to implement this.) Type the
  639. first few characters, and then press the key marked `INSERT' (or
  640. `CLR/HOME'), while you are in *mini*.  If you are in buffer
  641. *gulam*, use `ESC' `ESC' (2 escapes).
  642.  
  643. The canonical form of the full path name of a file begins with a letter
  644. designating the disk drive, followed by a colon, a back-slash separated
  645. list of identifiers.  All but the last of these identifiers must be a
  646. directory name.  In the non-standard form, you may also use a dot `.', and
  647. dot-dot `..' in place of the identifiers in appropriate contexts.  Whenever
  648. *Gulam* completes your filenames, it will produce the standard form
  649. full path names.
  650.  
  651. *Gulam* will standardize, in three situations, non-standard form of
  652. a `path', as shown in the example below.  These situations are:
  653.   1. Tenex file name expansion is invoked.
  654.   2. the word contains meta characters.
  655.   3. the name is being given to one of the file operations in `ue'.
  656.  
  657. `e:\gulam\a:\lex.c' is standardized to `a:\lex.c'
  658. `e:\gulam\\src\util.c' is standardized to `c:\src\util.c'
  659. `e:\gulam\~\ex.o' is standardized to `d:\bin\ex.c'
  660.  
  661. assuming that the current drive was `c:\', and home was `d:\bin', and
  662. variable `parent_expand' is set.  This is especially nice inside
  663. `ue' when visiting other files.
  664.  
  665. Words, as given by the you, that contain meta characters (which are
  666. `*?|()[]') or the string `...' are expanded.  In general, one
  667. such word produces a list of file names.  These file name regular
  668. expressions (fnmre) are like regular expressions (re), but have different
  669. semantics.  Occurrences of an fnmre, outside of strings, are replaced by
  670. the sorted blank-separated list of file names matching the fnmre.  An fnmre
  671. differs from re in (1) `.' stands for itself; (2) `*' is matches zero or
  672. more arbitrary characters.  Question mark matches any one character.
  673. `[a-g]' matches any one letter in a, b, ..., g.  `[zen]' matches one of z,
  674. e, or n.  Parentheses serve to group expressions.  An exp `g*' matches file
  675. names that begin with a `g'; `*.c' matches those ending in `.c'
  676.  
  677. The 3 dots, as in `c:\tex\...', stand for all the names
  678. of the files in the subtree at `c:\tex'.  If `c:\tex' has
  679. subdirectories, and so on, all their names and files they contain are
  680. included.  Thus, `echo e:\...\*.c' will show all the `.c'
  681. files in all the directories on drive e.  Remember that `...'
  682. expansion causes many directories to be visited.  This is not only
  683. time consuming, but also seems to trigger the Atari TOS's 40 folder
  684. bug after a few such operations.  (In my tests, I never lost a file as
  685. a result.  Nor can I tell precisely when and in what form this shows
  686. up.  Most frequent indication was that `cd' to an existing drive
  687. would fail.)
  688.  
  689. File: gulam.info  Node: flags, Prev: expressions, Up: top, Next: history-substitutions
  690.  
  691. Flags
  692. -----
  693.  
  694. Most commands (built-in or external) take flags to alter the behavior of
  695. the command in a minor way.  The convention made popular by Unix shells is
  696. adopted here for *Gulam*'s built-ins: a flag is of the form
  697. `-C', or `+C', where C stands for one
  698. character.  The option `-i', which interrogates you for each of the
  699. operand of the command before executing it, is provided on most commands.
  700.  
  701. File: gulam.info  Node: foreach, Prev: file-names, Up: Glossary, Next: format
  702.  
  703. foreach
  704. -------
  705.  
  706. The `foreach' command is used in shell scripts (but not at the
  707. terminal) to specify repetition of a sequence of commands while the value
  708. of a certain shell variable ranges through a specified list.  The
  709. `foreach' command ends with an `endfor' on a separate line all by
  710. itself.
  711.  
  712.      foreach i { a b c *.o [a-k]*[ch] } 
  713.              echo $i 
  714.      endfor 
  715.  
  716. File: gulam.info  Node: format, Prev: foreach, Up: Glossary, Next: gem
  717.  
  718. format
  719. ------
  720.  
  721. This command formats diskettes, in the standard form (360K, or 720K) in
  722. either the `A' or `B' floppy drive.  It does not touch
  723. hard-/ram-disks, no matter what arguments (illegal or not) you give it.
  724. Its valid arguments are either `a', `b', or both.  The optional
  725. flag `-2' implies double-sided formatting; otherwise the diskette is
  726. formatted single-sided.
  727.  
  728.      format        # does nothing 
  729.      format b      # format the floppy in dr B, single-sided 
  730.      format -1 b   # same as format b 
  731.      format -2 a   # format the floppy in dr A, double-sided 
  732.  
  733. If you issue the wrong command (e.g., `format -2 a' on a single-sided
  734. drive), you will hear a lot of grinding noises; a `control-C' will kill
  735. this, but not right away.
  736.  
  737. File: gulam.info  Node: gem, Prev: format, Up: Glossary, Next: grep
  738.  
  739. gem
  740. ---
  741.  
  742. The word `gem' is a prefix, like `time' is, to commands.  This
  743. enables proper running via *Gulam* of most programs that use the
  744. desktop metaphor.  It clears screen, turns cursor off, enables mouse and
  745. then executes the command, and after the command is finished it again
  746. clears screen, turns cursor on, disables mouse.
  747.  
  748. The `time' and `gem' prefixes mix in either order, and the
  749. command name will be searched for in the usual way.
  750.  
  751. We do not know, for sure, if all desktop/window/mouse oriented programs can
  752. be run properly with this command prefix.  So experiment, and be ready to
  753. hit the reset button before using the prefix.
  754.  
  755. `dvi' is an example of a command that needs to be run with `gem'
  756. prefix.  And you may be tempted to do the following.
  757.  
  758.      alias dvi 'gem dvi'              # recurses infinitely 
  759.      alias dzz dvi                    # dzz or whatever 
  760.      alias dvi 'gem dzz'              # will work 
  761.      alias dvi 'gem c:\bin\dvi.prg'   # also will work 
  762.  
  763. File: gulam.info  Node: grep, Prev: gem, Up: Glossary, Next: gulam.g
  764.  
  765. grep/egrep/fgrep
  766. ----------------
  767.      grep/egrep/fgrep RE-PATTERN FILENAMES
  768.  
  769. The `grep' command searches through a list of argument files for a
  770. specified string.  Thus
  771.  
  772.      grep lex[aw] e:\gulam\*.c 
  773.  
  774. will print each line in the files that contains a substring matching
  775. `lex[aw]'. `grep' stands for "globally find regular expression
  776. matches and print". `grep' and `egrep' are one and the same.
  777. The first argument to `egrep' is a regular expression, and the rest
  778. are expected to be file names. `fgrep''s first argument is the as-is
  779. string to be searched for in the files.  Because of the preprocessing done
  780. by *Gulam*, the as-is string for `fgrep' or the regular exp for
  781. `egrep' is generally enclosed in single-quotes.
  782.  
  783. File: gulam.info  Node: gulam.g, Prev: grep, Up: Glossary, Next: help
  784.  
  785. gulam.g
  786. -------
  787.  
  788. Files with the `.g' extension are expected to contain *Gulam*
  789. commands; `gulam.g' is the name of the startup file.  *Gulam*
  790. attempts to find this file in the current directory, and if found executes
  791. its contents.  Here is an example file:
  792.  
  793.      # bgn of my gulam.g
  794.      
  795.      set prompt      '$ncmd $cwd gu > $u'
  796.      set histfile    e:\history.g
  797.      set baud_rate   9600
  798.      set sz_rs232_buffer     4096
  799.      # set palette; note the trailing '-'
  800.      set rgb '005-707-070-075-'
  801.      # the following sets tabs on Epson MX-80
  802.      set pr_bof '^Q033^QD^Q010^Q020^Q030^Q040^Q050^Q033^QC^Q102'
  803.      set pr_eof '^Q214'
  804.      set pr_eop '^Q214^Qn'
  805.      set pr_eol '^Qr^Qn'
  806.      
  807.      #setenv PATH c:\bin,d:\bin,f:  # no trailing back slashes
  808.      #rehash
  809.      set path c:\bin,d:\bin,f:      # this is equiv to above 2 lines
  810.      setenv TEMP f:\
  811.      alias h   history
  812.      alias ll  ls -lF
  813.      alias p   more
  814.      alias rm rm -i # asks before deleting
  815.      alias ug 'ue e:\gulam\$1.c'
  816.      alias cg 'f:\cc.ttp -c -V -Ie:\gulam -DMWC e:\gulam\$1.c'
  817.      alias cpall 'cp e:\ue\*.o e:\gulam*.o f:\ '
  818.      alias bk 'cp e:\gulam\*.[chs] a:\ '
  819.      # end of my gulam.g
  820.  
  821.  
  822. Gulam Variables and Environment
  823. -------------------------------
  824.  
  825. The following shell variables cause/control useful effects.  The format of
  826. the explanation is `variable_name: default-value meaning'.
  827.  
  828. `batch_max_nesting: 20'     
  829.      if you need to nest batch file execution at levels deeper than this,
  830.      change this variable.
  831.      
  832. `batch_echo: 0'     
  833.      if  1  echoes each command of the batch file as it is executed.  
  834.      
  835. `baud_rate: none'     
  836.      for  use  in  the  terminal  emulator, rx/sx file transfers.  
  837.      
  838. `cwd:'     
  839. `CWD: full  pathname  of  current directory'     
  840.      gets re-set every time a cd, pushd or popd is executed.  
  841.      
  842. `delay: unset'     
  843.      set it to control the duration that the cursor sits
  844.      on a matching paren, bracket, or brace.  A value of 2000 produces about
  845.      a 2-sec delay.
  846.      
  847. `dir_cache: 0'     
  848.      if non-0, turns on the dir list cache.  This substantially speeds up the
  849.      Tenex file name completion.
  850.      
  851. `ginprompt: $<'     
  852.      the  prompt  shown  when  asking you for input in dollar-substituting a $<.
  853.      
  854. `gulam_help_file: none'     
  855.      set this var to the full pathname of the `gulam.hlp' file, which
  856.      contains descriptive info about keys, functions, bindings and
  857.      commands.  Unless this var is set properly, the wall chart that
  858.      `ue' generates is of not much use.
  859.      
  860. `histfile: none'     
  861.      reads and saves history in file named $histfile .
  862.      
  863. `history: 20'     
  864.      This variable controls the number of previous commands displayed
  865.      by the command `history'.
  866.      
  867. `home'     
  868. `HOME: full pathname of home directory'     
  869.      home  is  the directory you were in before invoking *Gulam*.  
  870.      
  871. `mscursor: unset'     
  872.      set it to a string of 4 digits (e.g., "0508").  This
  873.      controls the scaling of mouse movements being turned into cursor keys.  If
  874.      it is set to "0000", mouse movements do not get translated to cursor keys.
  875.      
  876.      
  877. `ncmd: number  of  the  current  command'     
  878.      gets  set  after each executing each command.  
  879.      
  880. `nrows: unset'     
  881.      This variable controls the number of lines per screen.  At present, only
  882.      valid values are 25 or 50.  Changing `nrows' to 50 will cause the
  883.      re-initialization of the screen using the small system font.
  884.      
  885. `path: unset'     
  886.      when set, it will cause the environment variable PATH to be
  887.      automatically also set to the same string ($path), and cause
  888.      rehashing.
  889.      
  890. `parent_expand: unset'     
  891.      when set, the Tenex name completion will provide the full path name rather
  892.      than just the leaf name.
  893.  
  894. The following pr_XXX vars are relevant with `print', and `lpr'
  895. commands.  When set, these strings are sent to the printer :
  896.  
  897. `pr_bof: unset'     
  898.      send before printing each new file.
  899. `pr_eol: rn'     
  900.      send after each line.
  901. `pr_eop:214'     
  902.      send after each page (214 == ASCII   + 0200). 
  903. `pr_eof: 214'     
  904.      send after the end of file.  
  905.  
  906. Thus, to have a left margin of eight-spaces, just define `pr_eol' as
  907. `rnt'.  To turn condensed mode etc., just set
  908. `pr_bof' to the appropriate string after looking it up in the
  909. printer's manual.  See the section on strings for an explanation of
  910. .
  911.  
  912. `prompt: >>'     
  913.      see gulam.g for an example.
  914. `prompt_tail: unset;'     
  915.      when set,   $prompt_tail  is  appended  to  the  displayed  prompt
  916.      string.   This is a kludge to mollify those of you who insist
  917.      on having a trailing blank in their prompt! 
  918. `rgb'     
  919. `RGB: `000-700-007-070-''     
  920.      sets  the  palette:  3 octal digits (followed by a  dummy  '-')  per
  921.      color;  2  in  hi-rez,  4  in med-rez, 16 in low-rez.
  922. `rx_remote_cmd: unset'     
  923.      command  to  send  to remote to receive file
  924.      with  Xmodem.   For  our  Unix, this string is `xm st'.  The rx
  925.      command  appends  a space followed by the file name and sends
  926.      the resulting string to the remote as if you typed it.  
  927. `sx_remote_cmd: unset'     
  928.      command to send to remote to send file with Xmodem.  Similar to the above.  
  929. `semicolon_max: 20'     
  930.      Number  of `;' per line; to stop infinite recursions in alias expanded
  931.      commands.
  932. `status'     
  933.      status  of  the  most  recent external command; set after each external
  934.      command.
  935. `sz_rs232_buffer: unset'     
  936.      The  built-in  terminal  emulator,  when invoked,  will  reallocate  a
  937.      buffer  of  this size (if this value  is  >  256) for the associated IOREC.
  938.      If unset, or if set  but  to  a  value  lower  than  4096, you may experience
  939.      XON/XOFF occuring at 9600.  I recommend 4096.
  940. `time: unset'     
  941.      If set to non-0, times every command.  
  942. `verbosity: unset'     
  943.      This controls the amount of feed back you get from *Gulam*.  When
  944.      unset, or set to <= 0, *Gulam* will be extremely quiet, and report
  945.      only on errors.  If you wish commands like `cp' to report the
  946.      goings-on, set verbosity to 2.
  947.  
  948.  
  949. HELP
  950. ----
  951.  
  952. The all-upper case name `HELP' in this manual stands for the key marked
  953. `HELP' on the Atari ST.  Pressing this key, outside the `ue', will
  954. show all the *Gulam* built-in commands, and a brief version of the
  955. hash table.  Within `ue', it can show the binding of an individual
  956. key, or produce a wall-chart of all bindings.
  957.  
  958. The `shift-HELP' key resets the special key table mapping that Gulam/uE
  959. use; after pressing `shift-HELP' the function keys, and arrow keys
  960. become equivalent to `', and the keypad will work as a typcial
  961. numerical keypad.  To get back to the Gulam/uE key table, press
  962. ` ', which not only refreshes the display but also sets the key
  963. table.
  964.  
  965. File: gulam.info  Node: help, Prev: grep, Up: Glossary, Next: history
  966.  
  967. help
  968. ----
  969.  
  970. Typing the letters `help' while outside `ue', or in buffer
  971. *gulam* is equivalent to pressing `HELP'.
  972.  
  973. File: gulam.info  Node: history, Prev: help, Up: Glossary, Next: if
  974.  
  975. history
  976. -------
  977.      history [-h]
  978.  
  979. The `history' command lists the last N commands.  Each command is
  980. preceded by its number; to suppress these numbers, supply the `-h'
  981. flag.  The value N is obtained by `$history'.  To change this N to,
  982. say, 30, do `set history 30'.
  983.  
  984. File: gulam.info  Node: history-substitutions, Prev: flags, Up: top, Next: io-redirection
  985.  
  986. History Substitutions
  987. ---------------------
  988.  
  989. Occurrences of the form `!!', `!number', `!string' refer to
  990. the text of previously issued commands.  The text of these older commands
  991. itself does not contain `!' unless it is part of a string argument.
  992. Each `!!' is replaced by the text of the immediately preceding
  993. command.  *Gulam* consecutively numbers the commands that you have
  994. issued.  (The current count can be seen in the shell variable named
  995. NCMD.) Each `!n' is replaced by the
  996. n-th  old  command.   Each  `!str' is a replaced by the most recent
  997. old command that begins with str.  
  998.  
  999. The name completion feature works with history substitutions also.
  1000. Pressing `INSERT' or `ESC-ESC' will bring the history-matched
  1001. command and replace the current line in the buffer, which you can further
  1002. edit.
  1003.  
  1004.  
  1005. $home also $HOME
  1006. ----------------
  1007.  
  1008. The shell variable "home" is initially set to the full pathname of the
  1009. directory from which *Gulam* was invoked.  However, it can be set
  1010. again with set command to whatever.  The wiggle `~' in file
  1011. names expands to "$HOME".  
  1012.  
  1013. File: gulam.info  Node: if, Prev: history, Up: Glossary, Next: lpr
  1014.  
  1015. if
  1016. --
  1017.  
  1018. The "if" stmt is similar to those in many programming languages.  The
  1019. Boolean expression of shell if stmts typically involves tests on file names
  1020. and types.  (See Expressions.) There is no `then'.  Any remaining
  1021. lexemes after the Boolean exp are ignored.
  1022.  
  1023.      if {-d e:\gulam\lex} + 2 == 3 
  1024.              echo e:\gulam\lex is a dir 
  1025.      ef -e e:\gulam\lex      # read ef as `else if' 
  1026.              echo e:\gulam\lex does exist 
  1027.      ef 
  1028.              echo e:\gulam\lex does NOT exist 
  1029.      endif 
  1030.  
  1031. File: gulam.info  Node: io-redirection, Prev: history-substitutions, Up: top, Next: metacharacter-expansion
  1032.  
  1033. IO Redirection
  1034. --------------
  1035.  
  1036. Prefixing a file name F with `>' causes all standard output
  1037. produced by that command to get deposited into file F.  Similarly,
  1038. `<g' will cause standard input to be taken from the file G
  1039. rather than the key board.  If you prefer, you may include white chars
  1040. between the `<' (or `>' ) and the filename.  If you have more
  1041. than one `<', or `>' in a command all but the last are ignored.
  1042.  
  1043. Note that because of TOS and compiler peculiarities, not all external
  1044. commands will behave as above.
  1045.  
  1046.      ls -l > lsout # get the ls -l output into file lsout
  1047.      ls -l >> f1   # append the ls -l output to f1
  1048.      ecmd '>blah'  # invoke ecmd and give it the arg >blah as is to it.  
  1049.  
  1050. File: gulam.info  Node: kb, Prev: if, Up: Glossary, Next: lpr
  1051.  
  1052. kb
  1053. --
  1054.  
  1055. This command redefines microEmacs keybindings.  To bind key with code 144
  1056. to function with hex-number 1d while you are in the *regular* buffer,
  1057. do
  1058.  
  1059.      kb -r 144 1d      
  1060.  
  1061. Use -g for redefining the bindings of *gulam* buffer; -m for mini
  1062. buffer.  You can find the key codes and hex-numbers of functions in the
  1063. wall-chart (shown below), which can be produced by pressing the `HELP'
  1064. key, a `B', and then a `r' (or `g', or `m').  The key
  1065. names, and function names will not appear unless a `set
  1066. gulam_help_file <filename>' was done earlier.
  1067.  
  1068.      key-code in hex
  1069.      |    function code in hex
  1070.      |    |    key name (kb ignores this)
  1071.      |    |    |         function name (kb ignores this)
  1072.      ---------------------------------------------------
  1073.      081  5c   F1         kill-backward-word
  1074.      082  5d   F2         kill-word
  1075.      083  20   F3         kill-line
  1076.      084  35   F4         copy-region-as-kill
  1077.      085  51   F5         kill-buffer
  1078.      086  50   F6         list-buffers
  1079.      087  4e   F7         switch-to-buffer
  1080.      088  3f   F8         write-file
  1081.      089  3d   F9         find-file
  1082.      08a  3e   F10        save-buffer
  1083.      08b  14   HELP       help
  1084.      08c  0d   UNDO       quick-exit
  1085.      08d  62   INSERT     scroll-down
  1086.      08e  61   HOME       scroll-up
  1087.      0bb  23   UPARRO     previous-line
  1088.      0bc  0f   DNARRO     gulam-forward-line
  1089.      0bd  1a   LTARRO     backward-char
  1090.      0be  1b   RTARRO     forward-char
  1091.      140  30   C-@       set-mark-command
  1092.      141  1e   C-A        beginning-of-line
  1093.      142  1a   C-B        backward-char
  1094.      143  06   C-C        switch-to-gulam-buffer
  1095.      144  1d   C-D        delete-char
  1096.      145  1f   C-E        goto-end-of-line
  1097.      146  1b   C-F        forward-char
  1098.      147  13   C-G        keyboard-quit
  1099.      148  1c   C-H        backward-delete-char
  1100.      149  11   TAB        goto-next-tab
  1101.      14a  25   LFD        newline-and-indent
  1102.      14b  20   C-K        kill-line
  1103.      14c  19   C-L        redraw-display
  1104.      14d  10   RET        gulam-do-newline
  1105.      14e  0f   C-N        gulam-forward-line
  1106.      14f  22   C-O        open-line
  1107.      150  23   C-P        previous-line
  1108.      151  33   C-Q        quoted-insert
  1109.      152  2b   C-R        search-backward
  1110.      153  2c   C-S        search-forward
  1111.      154  34   C-T        transpose-chars
  1112.      156  61   C-V        scroll-up
  1113.      157  36   C-W        kill-region
  1114.      159  3b   C-Y        yank
  1115.      15a  0e   C-Z        temporary-exit
  1116.      15f  14   C-_        help
  1117.      029  6b   )          blink-matching-paren-hack
  1118.      07d  6b   }         blink-matching-paren-hack
  1119.      05d  6b   ]          blink-matching-paren-hack
  1120.      0c0  0c   KLP        move-window-dn
  1121.      0c1  0b   KRP        move-window-up
  1122.      0c7  4a   KSLASH     split-window-vertically
  1123.      0c2  49   KSTAR      delete-other-windows
  1124.      0c5  45   KMINUS     previous-window
  1125.      0c3  44   KPLUS      next-window
  1126.      0c4  17   KENTER     call-last-kbd-macro
  1127.      0c6  26   KDOT       goto-line
  1128.      0b0  0a   K0         terminal-emulator
  1129.      0b7  55   K7         beginning-of-buffer
  1130.      0b8  32   K8         recenter
  1131.      0b9  54   K9         end-of-buffer
  1132.      0b4  5a   K4         backward-word
  1133.      0b5  23   K5         previous-line
  1134.      0b6  5e   K6         forward-word
  1135.      0b1  1e   K1         beginning-of-line
  1136.      0b2  0f   K2         gulam-forward-line
  1137.      0b3  1f   K3         goto-end-of-line
  1138.      541  09   C-X C-A    show-key-board-macro
  1139.      542  50   C-X C-B    list-buffers
  1140.      543  12   C-X C-C    save-buffers-kill-emacs
  1141.      546  3d   C-X C-F    find-file
  1142.      549  4d   C-X TAB    insert-buffer
  1143.      54f  41   C-X C-O    delete-blank-lines
  1144.      54e  0c   C-X C-N    move-window-dn
  1145.      550  0b   C-X C-P    move-window-up
  1146.      552  08   C-X C-R    read-file
  1147.      553  3e   C-X C-S    save-buffer
  1148.      556  3d   C-X C-V    find-file
  1149.      557  3f   C-X C-W    write-file
  1150.      558  42   C-X C-X    exchange-point-and-mark
  1151.      55a  46   C-X C-Z    shrink-window
  1152.      421  27   C-X !      execute-one-Gulam-command
  1153.      421  07   C-X !      execute-buffer
  1154.      43d  43   C-X =      what-cursor-position
  1155.      428  15   C-X (      start-kbd-macro
  1156.      429  16   C-X )      end-kbd-macro
  1157.      431  49   C-X 1      delete-other-windows
  1158.      432  4a   C-X 2      split-window-vertically
  1159.      442  4e   C-X B      switch-to-buffer
  1160.      445  17   C-X E      call-last-kbd-macro
  1161.      446  18   C-X F      no-op
  1162.      449  3c   C-X I      file-insert
  1163.      44b  51   C-X K      kill-buffer
  1164.      44e  44   C-X N      next-window
  1165.      44f  44   C-X O      next-window
  1166.      450  45   C-X P      previous-window
  1167.      453  52   C-X S      save-some-buffers
  1168.      45a  47   C-X Z      enlarge-window
  1169.      348  5c   ESC C-H    kill-backward-word
  1170.      221  07   ESC !      execute-buffer
  1171.      22e  30   ESC .      set-mark-command
  1172.      23e  54   ESC >      end-of-buffer
  1173.      23c  55   ESC <      beginning-of-buffer
  1174.      25b  56   ESC [      beginning-of-paragraph
  1175.      25d  57   ESC ]      end-of-paragraph
  1176.      225  2f   ESC %      query-replace
  1177.      220  59   ESC SPC    just-one-space
  1178.      242  5a   ESC B      backward-word
  1179.      243  5b   ESC C      capitalize-word
  1180.      244  5d   ESC D      kill-word
  1181.      246  5e   ESC F      forward-word
  1182.      247  06   ESC G      switch-to-gulam-buffer
  1183.      24c  5f   ESC L      downcase-word
  1184.      251  29   ESC Q      fill-paragraph
  1185.      252  2b   ESC R      search-backward
  1186.      253  2c   ESC S      search-forward
  1187.      255  60   ESC U      upcase-word
  1188.      256  62   ESC V      scroll-down
  1189.      257  35   ESC W      copy-region-as-kill
  1190.      27f  5c   ESC DEL    kill-backward-word
  1191.      35b  05   ESC ESC    expand-name-gulam-style
  1192.      344  63   ESC C-D    expand-names-and-show-them
  1193.      346  04   ESC C-F    file-name
  1194.      07f  1c   DEL        backward-delete-char
  1195.      0ab  37   SHIFT-HELP keys-reset
  1196.      000  00   NUL        no-op
  1197.      000  00   NUL        no-op
  1198.      000  00   NUL        no-op
  1199.      000  00   NUL        no-op
  1200.      000  00   NUL        no-op
  1201.      000  00   NUL        no-op
  1202.      000  00   NUL        no-op
  1203.      000  00   NUL        no-op
  1204.      000  00   NUL        no-op
  1205.      000  00   NUL        no-op
  1206.  
  1207. File: gulam.info  Node: lpr, Prev: if, Up: Glossary, Next: ls
  1208.  
  1209. lpr
  1210. ---
  1211.      lpr FILENAMES
  1212.  
  1213. The command `lpr' prints its files as-is, with no processing at the
  1214. end of lines.
  1215.  
  1216. File: gulam.info  Node: ls, Prev: lpr, Up: Glossary, Next: mem
  1217.  
  1218. ls
  1219. --
  1220.      ls [-ltrRLF] FILENAMES 
  1221.  
  1222. The `ls' (list files) command, with no arguments, prints the sorted
  1223. list of names of the files in the current directory.  It has a number of
  1224. useful flag arguments, and can also be given the names of directories as
  1225. arguments, in which case it lists the names of the files in these
  1226. directories.
  1227.  
  1228. If no flags are given, `ls' prints only the filenames.  The `-L'
  1229. causes a full-length line for each file giving its attributes, size,
  1230. creation date, and name.  The `-l' (small el) is the same as `-L'
  1231. except that the output is sorted by name.  The `-R' will cause the
  1232. subtrees of directories in the argument list of files to be traversed.  The
  1233. `-F' will append to each listed filename one char that indicates the
  1234. type of that file: `*' if it is executable (i.e., has an extension of
  1235. `.prg, .tos, .ttp', or `.g'), a `\' if its is a directory, a
  1236. ' ' otherwise.  The `-t' causes a sort by time of modification of the
  1237. files.  The `-r' reverses the chosen order of sorting.
  1238.  
  1239. `ls' always (even if DIR_CACHE is 1)
  1240. updates the directory cache for the relevant directories.
  1241.  
  1242. File: gulam.info  Node: mem, Prev: ls, Up: Glossary, Next: mkdir
  1243.  
  1244. mem
  1245. ---
  1246.  
  1247. `mem' shows the list of free chunks of memory available.  It does
  1248. this by following lists starting at an (undocumented) TOS location
  1249. (`0x7e8e' for ROMS dated 04221987, `56ec' for older ROMS),
  1250. Because of the way *Gulam* uses dynamically allocated memory,
  1251. the size of the largest free chunk fluctuates both up and down as
  1252. chunks get coalesced and split.
  1253.  
  1254.     `mem -a' shows not only the free list, but also GEMDOS list of
  1255. Malloc-ated chunks.
  1256.  
  1257. File: gulam.info  Node: metacharacter-expansion, Prev: io-redirection, Up: top, Next: path
  1258.  
  1259. Metacharacter Expansion
  1260. -----------------------
  1261.  
  1262. The characters `!$()[]><~*?', called "meta characters", have
  1263. special meaning to *Gulam*.  If it is necessary to embed these
  1264. characters in arguments to commands but without such special meaning, you
  1265. must enclose the argument in single-quotes.
  1266.  
  1267. Arguments (to built-in or external commands) that contain meta chars are
  1268. expanded as follows.  The `!' is expanded first; see History
  1269. Substitution.  After this, the meta chars `$()[]~*?' are expanded from
  1270. left-to-right.  See Dollar Substitution.  The wiggle `~' stands for
  1271. `$HOME'.  The remaining meta chars `()[]*?' are part of the
  1272. "fnmre" -- regular expressions for file names.  Fnmre are slightly
  1273. different from egrep's Regular Expressions.  An fnmre differs from re in
  1274. (1) `.' stands for itself; (2) `*' is matches zero or more arbitrary
  1275. characters.  Occurrences of an fnmre, outside of strings, are replaced by
  1276. the sorted blank-separated list of file names matching the fnmre; see also
  1277. File Names.
  1278.  
  1279. File: gulam.info  Node: mkdir, Prev: mem, Up: Glossary, Next: mv
  1280.  
  1281. mkdir
  1282. -----
  1283.      mkdir NAMES
  1284.  
  1285. The "mkdir" command creates new directories with the arguments as their
  1286. names.
  1287.  
  1288.  
  1289. more
  1290. ----
  1291.  
  1292. This is a built-in alias, if you will, to `ue -r'.
  1293.  
  1294. File: gulam.info  Node: mv, Prev: mkdir, Up: Glossary, Next: mson
  1295.  
  1296. mv
  1297. --
  1298.      mv FILENAMES TARGET-DIR
  1299.      mv FILENAME1 FILENAME2
  1300.  
  1301. Moves files.  In the first form, any number of files may be moveed into the
  1302. destination directory; files in the target dir will have their original
  1303. names.  In the second form, only one file is moved, and the new one will be
  1304. named filename2.  On the Atari ST, moving files is accomplished by copying
  1305. and then deleting the source file unless it is the second form and both are
  1306. in the same directory.
  1307.  
  1308. File: gulam.info  Node: mson, Prev: mv, Up: Glossary, Next: peekw
  1309.  
  1310. mson/msoff
  1311. ----------
  1312.  
  1313. These commands enable/disable the mouse.  To make the mouse disappear
  1314. give the command  `msoff' and to make it re-appear again, give the
  1315. command `mson'.  Most GEM-based `.prg' programs use mouse, but do
  1316. not set it up themselves.  Some of these will hang if invoked from
  1317. *Gulam*, which is no big deal; do `mson' and then try.
  1318.  
  1319. *Gulam* makes use of the mouse in two effective ways.
  1320. (1) When in Gulam command mode, moving the mouse around
  1321. allows you to select among previous commands that you
  1322. have in your history.  You can edit these in the usual
  1323. way with `ue' like commands.
  1324. (2) When editing a buffer with `ue', moving the mouse around
  1325. will move the cursor around the screen.
  1326.  
  1327. To modify the effect of the mouse, set the variable  `mscursor'
  1328. to a four digit number.  The command
  1329. `set mscursor 0508'
  1330. is equivalent to the default mouse action.  The command
  1331. `set mscursor 1016'
  1332. you will require twice as much movement of the mouse to get the
  1333. same effect on the screen, and
  1334. `set mscursor 0000'
  1335. will turn it off altogether.
  1336.  
  1337.  
  1338. File: gulam.info  Node: path, Prev: metacharacter-expansion, Up: top, Next: query-search-replace
  1339.  
  1340. $path also $PATH
  1341. ----------------
  1342.  
  1343. A comma-separated list (with no white chars) of directiries should be
  1344. the value of the environment variable `PATH'.  `PATH' can be
  1345. set independently by using `setenv', however, it gets
  1346. automatically reset to the value of `path' every time you do a
  1347. `set path whatever'.  This value is used by `rehash'
  1348. command.  `rehash' scans the files in each directory looking for
  1349. executable files (by def, files with extensions of `.prg',
  1350. `.tos', `.ttp', or `.g').  The leaf names and full
  1351. pathnames are entered into a hash table.  Typing the `help'
  1352. command (not the `HELP' key) will list the hash table in brief;
  1353. `which' command lists it in full.  *Gulam* does NOT auto
  1354. rehash whenever `PATH' is changed, but does rehash whenever
  1355. `path' is changed.
  1356.  
  1357.      setenv PATH c:,c:\bin,d:\mwc\bin 
  1358.  
  1359. File: gulam.info  Node: peekw, Prev: mson, Up: Glossary, Next: popd
  1360.  
  1361. peekw/pokew
  1362. -----------
  1363.  
  1364. `peekw' and `pokew' are similar to their namesakes in BASIC.  We
  1365. use privileged mode to alter/access any arbitrary location.  These commands
  1366. expect their arguments to be hex numbers, so do not begin the numbers with
  1367. `0x', or `$'.  The pokew command should be used with care.
  1368.  
  1369.      peekw 420      # shows you what is at word at 0x420 
  1370.      pokew 420 123E # sets word at 0x420 to 0x123E 
  1371.  
  1372. The primary use for these is to examine/alter the TOS variables.  Refer to
  1373. BIOS Hitch Hikers Guide, ST Internals, or some other documentation for a
  1374. full list of these locations.  Here are a few that I often found useful:
  1375.  
  1376. `420 memvalid' Normally contains 0x7520.  If you then press reset the
  1377. ST will do a `warm boot' (which leaves most reset survivable RAM disks to
  1378. be still alive).  If you want to cause a cold boot, `pokew' this
  1379. location to a zero.  (The other way is to power cycle.)
  1380.  
  1381. `42E' and `0x430 phystop' This pair of integers (a long) gives
  1382. the address of top of RAM.
  1383.  
  1384. `440 seekrate' contains a code for the seek rate of floppies: 0 means
  1385. 6 msec, 1 means 12 msec, 2 means 2 msec, and 3 means 3 msec.
  1386.  
  1387. `444 fverify' If `pokew' to zero, disk writes are not verified; any
  1388. other value will.
  1389.  
  1390. File: gulam.info  Node: popd, Prev: peekw, Up: Glossary, Next: print
  1391.  
  1392. popd
  1393. ----
  1394.  
  1395. The `popd' command changes the shell's working directory to the one on
  1396. top of the directory stack.  Also, sets `cwd', and `CWD'.
  1397.  
  1398. File: gulam.info  Node: print, Prev: popd, Up: Glossary, Next: printenv
  1399.  
  1400. print
  1401. -----
  1402.      print FILENAMES
  1403.  
  1404. The `print' command is used to prepare listings of the contents
  1405. of files with headers giving the name of the file and the date and
  1406. time at which the file was last modified.  Use the `date' command
  1407. to set the time and date of the system properly.
  1408.  
  1409. File: gulam.info  Node: printenv, Prev: print, Up: Glossary, Next: pushd
  1410.  
  1411. printenv
  1412. --------
  1413.  
  1414. The `printenv' command is equivalent to `setenv' with no
  1415. arguments.
  1416.  
  1417.  
  1418. $prompt
  1419. -------
  1420.  
  1421. *Gulam* prompts for input with the contents of this variable.  Set
  1422. it with the `set' command.
  1423.  
  1424.      set prompt      '$ncmd $cwd gu > $u' 
  1425.  
  1426. File: gulam.info  Node: pushd, Prev: printenv, Up: Glossary, Next: pwd
  1427.  
  1428. pushd
  1429. -----
  1430.      pushd [DIR]
  1431.  
  1432. The `pushd' (push directory) command pushes the name of the current
  1433. directory on to the internal stack, and `cd''s to the directory given
  1434. by the argument.  You can later do a `popd' to return to the present
  1435. current directory.  The command `pushd', without arguments, exchanges
  1436. the working directory with the one on top of the stack.
  1437.  
  1438. File: gulam.info  Node: pwd, Prev: pushd, Up: Glossary, Next: rehash
  1439.  
  1440. pwd
  1441. ---
  1442.  
  1443. This built-in command prints the full pathname of the current working
  1444. directory.  It is equivalent to
  1445.  
  1446.          echo $cwd
  1447.  
  1448. File: gulam.info  Node: query-search-replace, Prev: path, Up: top, Next: regular-expressions
  1449.  
  1450. Query Search/Replace
  1451. --------------------
  1452.  
  1453. The built-in `ue' uses regular expression search and replace; see
  1454. Regular Expressions.  This function is normally bound to `ESC-%'.  When
  1455. you invoke it, it will ask you to type the search pattern, and then the
  1456. replace pattern.  It then enters the search/replace mode: finds the next
  1457. (to the right, and below) occurrence of the search pattern, and awaits your
  1458. response.  You type
  1459.   1. a `SPACE' to replace the occurrence of the
  1460.      search pattern
  1461.   2. a `DELETE' to skip to the next occurrence
  1462.   3. a dot (`.') to replace this one and then terminate search/replace
  1463.   4. `ESC' to end the search/replace right now, and
  1464.   5. an exclamation (`!') to replace this and all further occurrences without
  1465.      bothering to ask you.
  1466.  
  1467. If you forget all this, type an arbitrary key and you will get the brief
  1468. reminder:
  1469.  
  1470.      <SP>rplce, [.]rep-end, <DEL>dont, [!]repl rest, <ESC>quit
  1471.  
  1472. The only char that has a special meaning in the replace string is `&'; all
  1473. other meta-chars stand literally for themselves.  An `&' stands for the
  1474. substring that matched the whole regular expression.  A `\n', where n is a
  1475. digit in 1 to 9, stands for the substring that matched the n-th
  1476. parenthesized expression within the regular expression, with parenthesized
  1477. expressions
  1478. numbered in left-to-right order of their opening parentheses.  
  1479.  
  1480. Be aware of a peculiarity of the search/replace: The `^' and `$'
  1481. of the regular expression match the positions just right of the dot, and
  1482. just left of the dot.  Thus, if you give a search string of '`^'', and
  1483. replace string '`a'', and then issue a '`!'', you will be
  1484. inserting '`a'' forever (until `ue' runs out of memory).
  1485.  
  1486. File: gulam.info  Node: regular-expressions, Prev: query-search-replace, Up: top, Next: strings
  1487.  
  1488. Regular Expressions
  1489. -------------------
  1490.  
  1491. [This  section  is a mildly edited man page of regexp(3) by Henry
  1492. Spencer.] 
  1493.  
  1494. A  regular  expression  is  zero  or  more branches, separated by
  1495. `|'.  It matches anything that matches one of the branches.  
  1496.  
  1497. A  branch  is  zero  or  more pieces, concatenated.  It matches a
  1498. match for the first, followed by a match for the second, etc.  
  1499.  
  1500. A  piece  is  an  atom possibly followed by `*', `+', or `?'.  An
  1501. atom  followed  by `*' matches a sequence of 0 or more matches of
  1502. the  atom.   An  atom  followed by `+' matches a sequence of 1 or
  1503. more  matches  of  the  atom.   An atom followed by `?' matches a
  1504. match of the atom, or the null string.  
  1505.  
  1506. An  atom is a regular expression in parentheses (matching a match
  1507. for  the  regular expression), a range (see below), `.' (matching
  1508. any  single  character),  `^'  (matching  the  null string at the
  1509. beginning  of the input string), `$' (matching the null string at
  1510. the  end  of  the  input  string),  a  `e'  followed  by a single
  1511. character  (matching  that character), or a single character with
  1512. no other significance (matching that character).  
  1513.  
  1514. A  range  is  a  sequence  of  characters  enclosed  in `[]'.  It
  1515. normally  matches any single character from the sequence.  If the
  1516. sequence  begins  with  `^',  it matches any single character not
  1517. from  the  rest  of  the  sequence.   If  two  characters  in the
  1518. sequence  are  separated  by  `-', this is shorthand for the full
  1519. list  of  ASCII characters between them (e.g. `[0-9]' matches any
  1520. decimal  digit).   To include a literal `]' in the sequence, make
  1521. it  the first character (following a possible `^').  To include a
  1522. literal `-', make it the first or last character.  
  1523.  
  1524. If  a  regular  expression could match two different parts of the
  1525. input  string,  it  will match the one which begins earliest.  If
  1526. both  begin  in  the  same  place but match different lengths, or
  1527. match  the  same  length in different ways, life gets messier, as
  1528. follows.  
  1529.  
  1530. In   general,  the  possibilities  in  a  list  of  branches  are
  1531. considered  in  left-to-right  order,  the possibilities for `*',
  1532. `+',  and `?' are considered longest-first, nested constructs are
  1533. considered  from  the  outermost  in, and concatenated constructs
  1534. are  considered leftmost-first.  The match that will be chosen is
  1535. the  one  that  uses the earliest possibility in the first choice
  1536. that  has to be made.  If there is more than one choice, the next
  1537. will  be  made  in the same manner (earliest possibility) subject
  1538. to the decision on the first choice.  And so forth.  
  1539.  
  1540. For  example,  `(ab|a)b*c'  could match `abc' in one of two ways.
  1541. The  first choice is between `ab' and `a'; since `ab' is earlier,
  1542. and  does  lead  to  a  successful  overall  match, it is chosen.
  1543. Since  the  `b'  is  already  spoken for, the `b*' must match its
  1544. last  possibility  the  empty  string  since  it must respect the
  1545. earlier choice.  
  1546.  
  1547. In  the  particular  case  where no `|'s are present and there is
  1548. only  one  `*',  `+',  or `?', the net effect is that the longest
  1549. possible   match  will  be  chosen.   So  `ab*',  presented  with
  1550. `xabbbby',  will  match  `abbbb'.   Note  that  if `ab*' is tried
  1551. against  `xabyabbbz',  it  will match `ab' just after `x', due to
  1552. the  begins-earliest  rule.  (In effect, the decision on where to
  1553. start  the match is the first choice to be made, hence subsequent
  1554. choices   must   respect   it   even   if   this  leads  them  to
  1555. less-preferred alternatives.) 
  1556.  
  1557. Here are some examples of usage: 
  1558.  
  1559.      ls *[sg]        # print file names ending in s or g
  1560.      egrep '(MWC|MEGAMAX|MANX)' *.c       
  1561.      egrep '^$' *.c  # print line numbers of empty lines
  1562.      egrep 'aa*' *.c
  1563.  
  1564. File: gulam.info  Node: rehash, Prev: pwd, Up: Glossary, Next: ren
  1565.  
  1566. rehash
  1567. ------
  1568.  
  1569. -- see PATH 
  1570.  
  1571. File: gulam.info  Node: ren, Prev: rehash, Up: Glossary, Next: rm
  1572.  
  1573. ren
  1574. ---
  1575.      ren FNM1 FNM2
  1576.  
  1577. Rename file FNM1 as FNM2; they both must be in the same
  1578. directory.
  1579.  
  1580. File: gulam.info  Node: rm, Prev: rx, Up: Glossary, Next: ren
  1581.  
  1582. rm
  1583. --
  1584.      rm FILENAMES
  1585.  
  1586. `rm' removes the named files.  Most of us have the following aliases
  1587. in our `gulam.g' files:
  1588.  
  1589.      alias rm rm -i 
  1590.      alias Rm rm 
  1591.  
  1592. which queries you, for each file, before deleting it.  We use `Rm'
  1593. when we are really sure we want to delete the file(s).  There is
  1594. no  special check to see if you typed `rm *.*' or `rm *'; both of
  1595. these will clear your current directory.  
  1596.  
  1597. File: gulam.info  Node: rx, Prev: rm, Up: Glossary, Next: set
  1598.  
  1599. rx/sx
  1600. -----
  1601.  
  1602. These are built-in commands.  `rx' receives file(s) from the remote
  1603. system; and `sx' sends file(s) to the remote system using Xmodem
  1604. protocol.
  1605.  
  1606.      rx FNM
  1607.  
  1608. command opens/creates file FNM for writing.  If the shell variable
  1609. `rx_remote_cmd' is set, *Gulam* constructs a command for the
  1610. remote system as `$rx_remote_cmd' FNM, and sends this command
  1611. through the rs232 port, and then awaits the packets.  For use with our
  1612. 4xBSD Unix, we set this var to `xm st'.  Unless the `xm' on the
  1613. remote machine is of the quiet type (one that does not respond with, say,
  1614. `Xmodem: Ready to send...'), setting `rx_remote_cmd' actually
  1615. prolongs the first synchronization.  If this var is unset, you should first
  1616. switch to remote (say using te command), and issue the appropriate command
  1617. to the remote, and then switch back to AtariST and give the `rx'
  1618. FNM command.
  1619.  
  1620.      sx FNM
  1621.  
  1622. is essentially similar.  *Gulam* opens FNM for reading, sends
  1623. `$sx_remote_cmd' FNM, if that var is set, and awaits the first
  1624. sync.  For our 4xBSD Unix, we set `sx_remote_cmd' to `xm rt'.
  1625.  
  1626.     If sending/receiving binary files use `xm rb' or `xm
  1627. sb' as the remote system's commands.  Note that files received with
  1628. Xmodem usually contain extraneous bytes at the very end of the file.
  1629. With text files, you often see a bunch of `ə's.
  1630.  
  1631.     When both `sx_remote_cmd' and `rx_remote_cmd' are set
  1632. appropriately, it is possible to transfers of batches of files.  For example,
  1633.  
  1634.      sx D1/D2/F1 D1/F2
  1635.  
  1636. will invoke `xm rt' on the far end and send file `d1/d2/f1',
  1637. and after this is finished invoke `xm rt' once again and send the
  1638. second file `d1/f2'.  The `rx' command also can smilarly
  1639. take multiple arguments.
  1640.  
  1641. File: gulam.info  Node: set, Prev: rx, Up: Glossary, Next: setenv
  1642.  
  1643. set
  1644. ---
  1645.      set [NAME VALUE]
  1646.  
  1647. The built-in `set' command is used to assign new values to shell
  1648. variables and to show the values of the current variables.  The command
  1649. without any arguments lists all the shell vars and their values.  When
  1650. arguments are present, second and subsequent words are processed as an
  1651. expression yielding a value which is then assigned to the first argument.
  1652. The `unset' command deletes a variable.
  1653.  
  1654.      set i  {$j > 10 } # sets i to 1 if $j is > 10; else to 0
  1655.      set x "hi there" 
  1656.      set y $i + 4 @ 2   # @ stands for multiplication 
  1657.  
  1658. File: gulam.info  Node: setenv, Prev: set, Up: Glossary, Next: source
  1659.  
  1660. setenv
  1661. ------
  1662.  
  1663. Variables in the environment can be changed by using the `setenv'
  1664. built-in command.  The `setenv' command without args prints the values
  1665. of all the variables in the environment.
  1666.  
  1667. File: gulam.info  Node: source, Prev: setenv, Up: Glossary, Next: te
  1668.  
  1669. source
  1670. ------
  1671.      source FILE-NAME
  1672.  
  1673. The contents of file FILE-NAME are excuted by *Gulam*.
  1674. Unless the FILE-NAME has an extension other than `.g', use
  1675. the simpler command `file.g' instead.
  1676.  
  1677.  
  1678. status
  1679. ------
  1680.  
  1681. A command normally returns a status when it finishes.  By convention a
  1682. status of zero indicates that the command succeeded, and *Gulam*
  1683. does not show this value.  Commands may return non-zero status, whic is
  1684. displayed, to indicate that some abnormal event has occurred.  The shell
  1685. variable status is set to the status returned by the last command.
  1686.  
  1687. File: gulam.info  Node: strings, Prev: regular-expressions, Up: top, Next: file-name-completion
  1688.  
  1689. Strings
  1690. -------
  1691.  
  1692. Strings are the most common data type that shells deal with.  In
  1693. *Gulam*, unless otherwise stated, all operands are considered to be
  1694. strings.  There are a few occasions when it is necessary to suppress the
  1695. typical string preprocessing such as meta-char expansion.  Such strings are
  1696. enclosed in single-quotes.  A string enclosed in double quotes is dollar-,
  1697. and meta-expanded, and then enclosed in double quotes.  Try, `echo
  1698. *.c' and `echo '*.c'' in a directory that has a few files with the
  1699. `.c' extension.  Within a quoted-string, you can include control
  1700. characters by inserting a `' (control-Q) followed by the octal
  1701. ASCII code (always using 3 digits) of the character; see the `gulam.g'
  1702. section for examples.  In general, if you want to set a var to a string
  1703. that contains control-chars, first write it out in the C language notation,
  1704. and replace each back-slash with a `control-Q'.
  1705.  
  1706. File: gulam.info  Node: te, Prev: source, Up: Glossary, Next: time
  1707.  
  1708. te/teexit
  1709. ---------
  1710.  
  1711. `te' (also  bound to `Keypad-0') gets you into the built-in terminal
  1712. emulator.   If  you have baud_rate set up properly (see gulam.g),
  1713. the  rs232  port  is set to that speed, and you are switched to a
  1714. fresh  screen.   Set  `sz_rs232_buffer'  to  a  large  value if you
  1715. encounter  XON/XOFF  problems  too frequently.  We have  used the
  1716. following  TERMCAP  and  used  vi,  GNU-Emacs  etc  without  any
  1717. problems.  
  1718.  
  1719.      st|st25|atariST|bw, std sys font, 25 lines, 80 col:
  1720.         :ae=Eba:al=EL:am:as=Ebc:
  1721.         :bl=^G:bs:
  1722.         :cd=EJ:ce=EK:cl=EHEJ:cm=EY%+ %+ :co#80:cr=^M:
  1723.         :dl=EM:do=EB:
  1724.         :ho=EH:
  1725.         :is=EvEe:
  1726.         :kd=274:kh=216:kl=275:kr=276:ku=273:
  1727.         :le=^H:li#25:
  1728.         :nd=EC:nl=^J:
  1729.         :pt:
  1730.         :se=Eq:so=Ep:sr=EI:
  1731.         :ta=^I:
  1732.         :up=EA:
  1733.      
  1734.      
  1735.      ST|ST25|atariSTcolor|as above but with color for stndout:
  1736.         :ae=Eba:al=EL:am:as=Ebc:
  1737.         :bl=^G:bs:
  1738.         :cm=EY%+ %+ :co#80:li#25:cr=^M:cd=EJ:ce=EK:cl=EHEJ:
  1739.         :dl=EM:do=^J:
  1740.         :ho=EH:
  1741.         :is=EvEe:
  1742.         :kd=274:kh=216:kl=275:kr=276:ku=273:
  1743.         :le=^H:
  1744.         :nd=EC:nl=^J:
  1745.         :pt:
  1746.         :so=Ec2Eb3:se=Ec0Eb3:sr:EI:
  1747.         :ta=^I:
  1748.         :up=EA:
  1749.      
  1750.      sT|st50|AtariST emulating vt52, bw, 50 lines, 80 col:
  1751.         :ae=Eba:al=EL:am:as=Ebc:
  1752.         :bl=^G:bs:
  1753.         :cd=EJ:ce=EK:cl=EHEJ:cm=EY%+ %+ :co#80:cr=^M:
  1754.         :dl=EM:do=^J:
  1755.         :ho=EH:
  1756.         :is=EvEe:
  1757.         :kd=274:kh=216:kl=275:kr=276:ku=273:
  1758.         :le=^H:li#50:
  1759.         :nd=EC:nl=^J:
  1760.         :pt:
  1761.         :se=Eq:so=Ep:sr=EI:
  1762.         :ta=^I:
  1763.         :up=EA:
  1764.  
  1765. To return to the local mode after having done `te', press `UNDO'.
  1766. Then a `Keypad-0' will take you back to remote with your remote screen
  1767. in tact.  After you are finally done with your remote system, press
  1768. `UNDO', and then issue a `teexit' to reclaim the 32k used for the
  1769. extra screen.
  1770.  
  1771. File: gulam.info  Node: file-name-completion, Prev: strings, Up: top
  1772.  
  1773. Tenex File Name Completion
  1774. --------------------------
  1775.  
  1776. Tenex is widely considered to be the first OS to implement the completion
  1777. of a file's name given the first few chars of it.  Experiment with the keys
  1778. marked `INSERT', `TAB' and `CLR/HOME', while you are in
  1779. *mini*.  If you are in buffer *gulam*, use `ESC-ESC' (2
  1780. escapes).  See File Names.
  1781.  
  1782. File: gulam.info  Node: time, Prev: te, Up: Glossary, Next: touch
  1783.  
  1784. time
  1785. ----
  1786.  
  1787. The word `time' when prefixed to a regular command, it prints the
  1788. elapsed time after the command finishes.  If you set variable
  1789. named `time'  to  a non-zero value, each and every command, even
  1790. if  they  are  not  prefixed  with  the  word `time',  will be so
  1791. timed.  
  1792.  
  1793.      time  ls -lF c:\        # See how long it takes 
  1794.      set   time  1           # After this, all command will be timed until 
  1795.      set   time 0            # you do this, or 
  1796.      unset time              # this 
  1797.  
  1798. If you set up aliases with `time' prefixes in them, watch out!  The
  1799. discussion under the section on Gem is applicable to `time' also.
  1800.  
  1801. File: gulam.info  Node: touch, Prev: time, Up: Glossary, Next: ue
  1802.  
  1803. touch
  1804. -----
  1805.      touch FNMS
  1806.  
  1807. `touch'  updates  the  time  stamp on the files to current time and
  1808. date.  
  1809.  
  1810. File: gulam.info  Node: ue, Prev: touch, Up: Glossary, Next: uekb
  1811.  
  1812. ue
  1813. --
  1814.      ue [-r] [FNMS]
  1815.  
  1816. This command takes you into the built-in microEmacs editor.  If
  1817. no  args  are  given,  you  will  land  in  the  *gulam*  buffer,
  1818. otherwise in the buffer of the last named file.  The output of
  1819. *Gulam* commands executed while you are within *gulam* is
  1820. entered into that buffer; this, of course, consumes malloc-space.
  1821. `Meta-g' brings you into *gulam* if you are in another buffer.
  1822.  
  1823. To examine the key bindings, press `HELP'-key first, and then a `B'
  1824. while inside `ue'.  To rebind them to suit your tastes, see `kb'.
  1825. On the Atari ST, all the keys are bound (thoughtfully, I hope) to useful
  1826. commands.  `F1' through `F5' delete things; `F6-F10' update
  1827. files and buffers; Keypad keys cause harmless cursor motions; `Keypad
  1828. 0' (zero) switches you to the (remote computer hooked to the) rs232 port;
  1829. to return to your local Atari, press `UNDO'.  `HELP' is for (not
  1830. much) help; `UNDO' will exit after saving files; the rest of the keys
  1831. in that group move the cursor around.
  1832.  
  1833. The `-r' flag causes the buffers of the files following the `-r'
  1834. to be marked as read-Only.  You can still edit these buffers; but the
  1835. read-Only mark causes `ue' to ask before writing to these files.
  1836.  
  1837. Do try `ə, ⑧-!' and `Meta-X-!' commands.  
  1838.  
  1839. File: gulam.info  Node: uekb, Prev: ue, Up: Glossary, Next: unalias
  1840.  
  1841. uekb
  1842. ----
  1843.  
  1844. The command `uekb' has been renamed as `kb'.
  1845.  
  1846. File: gulam.info  Node: unalias, Prev: uekb, Up: Glossary, Next: unset
  1847.  
  1848. unalias
  1849. -------
  1850.      unalias [ALIASSED-NAME]
  1851.  
  1852. The unalias command removes aliases.   
  1853.  
  1854. File: gulam.info  Node: unset, Prev: unlalias, Up: Glossary, Next: which
  1855.  
  1856. unset unsetenv
  1857. --------------
  1858.      unset [VAR-NAME]
  1859.      unsetenv [ENV-VAR]
  1860.  
  1861. The unset command removes the definitions of shell variables.  
  1862.  
  1863.  
  1864. variables
  1865. ---------
  1866.  
  1867. See also: *Gulam* Vars and Environment; Dollar Subst.  
  1868.  
  1869. A variable name is any sequence of characters not containing delimiters.  A
  1870. Variable in *Gulam* holds a string as its value.  Depending on the
  1871. context this string is evaluated to yield a numeric value.
  1872.  
  1873. File: gulam.info  Node: which, Prev: unset, Up: Glossary, Next: while
  1874.  
  1875. which
  1876. -----
  1877.  
  1878. The `which' command displays the internal table of names of external
  1879. commands, and the full pathnames of the files that contain them.  If
  1880. nothing  gets  displayed,  either  you did not do a `rehash', did
  1881. not  setenv  the PATH, or none of the directories in PATH had any
  1882. executables.  
  1883.  
  1884. File: gulam.info  Node: while, Prev: which, Up: Glossary
  1885.  
  1886. while
  1887. -----
  1888.  
  1889. The `while' built-in control construct is used in shell command
  1890. scripts.  Instead of echo and set in the body of the loop shown below, you
  1891. can use other commands.
  1892.  
  1893.      set i 10 
  1894.      while  { $i >  0 } 
  1895.            echo $i 
  1896.            set i $i - 1 
  1897.      endwhile 
  1898.  
  1899. File: gulam.info  Node: Variables Index, Prev: top, Up: top, Next: Command Index
  1900.  
  1901. Variable Index
  1902. **************
  1903.  
  1904.  
  1905. * Menu:
  1906.  
  1907. * $prompt: printenv.
  1908. * batch_echo: gulam.g.
  1909. * batch_max_nesting: gulam.g.
  1910. * baud_rate: gulam.g.
  1911. * CWD: cp.
  1912. * cwd: cp.
  1913. * CWD: gulam.g.
  1914. * cwd: gulam.g.
  1915. * delay: gulam.g.
  1916. * dir_cache: gulam.g.
  1917. * env_style: endfor.
  1918. * ginprompt: gulam.g.
  1919. * gulam_help_file: gulam.g.
  1920. * histfile: gulam.g.
  1921. * history: gulam.g.
  1922. * HOME: gulam.g.
  1923. * home: gulam.g.
  1924. * HOME: history-substitutions.
  1925. * home: history-substitutions.
  1926. * mscursor: gulam.g.
  1927. * ncmd: gulam.g.
  1928. * nrows: gulam.g.
  1929. * parent_expand: gulam.g.
  1930. * PATH: gulam.g.
  1931. * path: gulam.g.
  1932. * PATH: mson.
  1933. * path: mson.
  1934. * prompt : gulam.g.
  1935. * prompt_tail: gulam.g.
  1936. * pr_bof: gulam.g.
  1937. * pr_eof: gulam.g.
  1938. * pr_eol : gulam.g.
  1939. * pr_eop: gulam.g.
  1940. * RGB: gulam.g.
  1941. * rgb: gulam.g.
  1942. * rx_remote_cmd: gulam.g.
  1943. * semicolon_max: gulam.g.
  1944. * status: gulam.g.
  1945. * status: source.
  1946. * sx_remote_cmd: gulam.g.
  1947. * sz_rs232_buffer: gulam.g.
  1948. * time: gulam.g.
  1949. * verbosity: gulam.g.
  1950.  
  1951. File: gulam.info  Node: Command Index, Prev: Variables Index, Up: top
  1952.  
  1953. Command Index
  1954. *************
  1955.  
  1956.  
  1957. * Menu:
  1958.  
  1959. * alias: builtins.
  1960. * builtins: Glossary.
  1961. * cat: alias.
  1962. * cd: cat.
  1963. * chmod: cd.
  1964. * cp: chmod.
  1965. * date: cp.
  1966. * df: date.
  1967. * dirc: dm.
  1968. * dirs: dirc.
  1969. * dir_cache: dm.
  1970. * dm: df.
  1971. * echo: dollar-substitutions.
  1972. * ef: echo.
  1973. * egrep: ef.
  1974. * egrep: gem.
  1975. * endfor: endif.
  1976. * endif: egrep.
  1977. * exit: endfor.
  1978. * fg: expressions.
  1979. * fgrep: gem.
  1980. * file-names: fg.
  1981. * foreach: flags.
  1982. * format: foreach.
  1983. * gem: format.
  1984. * grep: gem.
  1985. * help: gulam.g.
  1986. * history: help.
  1987. * if: history-substitutions.
  1988. * kb: io-redirection.
  1989. * lpr: kb.
  1990. * ls: lpr.
  1991. * mem: ls.
  1992. * mkdir: metacharacter-expansion.
  1993. * msoff: mv.
  1994. * mson: mv.
  1995. * mv: mkdir.
  1996. * peekw: path.
  1997. * pokew: path.
  1998. * popd: peekw.
  1999. * print: popd.
  2000. * printenv: print.
  2001. * pushd: printenv.
  2002. * pwd: pushd.
  2003. * rehash: regular-expressions.
  2004. * ren: rehash.
  2005. * rm: ren.
  2006. * rx: rm.
  2007. * set: rx.
  2008. * setenv: set.
  2009. * source: setenv.
  2010. * sx: rm.
  2011. * te: strings.
  2012. * teexit: strings.
  2013. * time: file-name-completion.
  2014. * touch: time.
  2015. * ue: touch.
  2016. * uekb: ue.
  2017. * unalias: uekb.
  2018. * unset: unalias.
  2019. * unsetenv: unalias.
  2020. * which: unset.
  2021. * while: which.
  2022.  
  2023.  
  2024. Tag table:
  2025. Node: top90
  2026. Node: usage4819
  2027. Node: lexical-conventions6443
  2028. Node: command-processing7841
  2029. Node: batch-files8392
  2030. Node: buffers9132
  2031. Node: command-line-editing11252
  2032. Node: invoking-gulam12093
  2033. Node: Glossary14299
  2034. Node: builtins14396
  2035. Node: alias15116
  2036. Node: cat16127
  2037. Node: cd16543
  2038. Node: chmod16824
  2039. Node: cp17249
  2040. Node: date18678
  2041. Node: df19081
  2042. Node: dm19248
  2043. Node: dirc19402
  2044. Node: dirs20262
  2045. Node: dollar-substitutions20528
  2046. Node: echo21154
  2047. Node: ef21362
  2048. Node: egrep21471
  2049. Node: endif21568
  2050. Node: endfor21667
  2051. Node: exit22101
  2052. Node: expressions22278
  2053. Node: fg23686
  2054. Node: file-names23981
  2055. Node: flags26956
  2056. Node: foreach27448
  2057. Node: format27901
  2058. Node: gem28715
  2059. Node: grep29769
  2060. Node: gulam.g30562
  2061. Node: help37413
  2062. Node: history37599
  2063. Node: history-substitutions37937
  2064. Node: if39088
  2065. Node: io-redirection39663
  2066. Node: kb40475
  2067. Node: lpr46720
  2068. Node: ls46896
  2069. Node: mem48057
  2070. Node: metacharacter-expansion48572
  2071. Node: mkdir49662
  2072. Node: mv49904
  2073. Node: mson50436
  2074. Node: path51547
  2075. Node: peekw52459
  2076. Node: popd53740
  2077. Node: print53953
  2078. Node: printenv54309
  2079. Node: pushd54630
  2080. Node: pwd55068
  2081. Node: query-search-replace55269
  2082. Node: regular-expressions57042
  2083. Node: rehash60837
  2084. Node: ren60936
  2085. Node: rm61101
  2086. Node: rx61567
  2087. Node: set63302
  2088. Node: setenv63937
  2089. Node: source64204
  2090. Node: strings64831
  2091. Node: te65834
  2092. Node: file-name-completion67802
  2093. Node: time68219
  2094. Node: touch68919
  2095. Node: ue69094
  2096. Node: uekb70401
  2097. Node: unalias70529
  2098. Node: unset70690
  2099. Node: which71190
  2100. Node: while71562
  2101. Node: Variables Index71900
  2102. Node: Command Index72903
  2103. End tag table
  2104.  
  2105.